using System;
using ShellLight.Contract.Attributes;

namespace ShellLight.Contract
{
    public static class UICommandExtensions
    {
        public static bool HasAttribute<T>(this UICommand uiCommand) where T: Attribute
        {
            var attachToTray = uiCommand.GetType().GetCustomAttributes(typeof(AttachToTrayAttribute), true);
            return(attachToTray != null && attachToTray.Length > 0);
        }
    }
}